
// 表单校验规则由 schema2code 生成，不建议直接修改校验规则，而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema



const validator = {
  "username": {
    "rules": [
      {
        "required": true
      },
      {
        "format": "string"
      }
    ],
    "label": "用户名"
  },
  "tclass_id": {
    "rules": [
      {
        "format": "array"
      }
    ],
    "label": "教学班"
  },
  "year": {
    "rules": [
      {
        "format": "int"
      }
    ],
    "defaultValue": 2020,
    "label": "年份"
  },
  "term": {
    "rules": [
      {
        "format": "int"
      },
      {
        "range": [
          {
            "text": "上学期",
            "value": 0
          },
          {
            "text": "下学期",
            "value": 1
          }
        ]
      }
    ],
    "defaultValue": 0,
    "label": "学期"
  },
  "credit": {
    "rules": [
      {
        "format": "int"
      }
    ],
    "defaultValue": 38,
    "label": "总学分"
  },
  "usedcredit": {
    "rules": [
      {
        "format": "int"
      }
    ],
    "defaultValue": 0,
    "label": "已用学分"
  },
  "schedule": {
    "rules": [
      {
        "format": "array"
      }
    ],
    "label": "排课表"
  }
}

const enumConverter = {
  "term_valuetotext": {
    "0": "上学期",
    "1": "下学期"
  }
}

export { validator, enumConverter }
